<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>All datasets</title>
    </h:head>
    <h:body>
        <p:layout fullPage="true">

                <p:layoutUnit  position="north" size="120" resizable="true" closable="true" collapsible="true">
                    <p:graphicImage width="1265" height="100" url="./img/header_dataset.jpg" title="DATA SET SIMILARITY"></p:graphicImage>
                </p:layoutUnit>

                <p:layoutUnit position="south" size="50" closable="true" collapsible="true">
                    <h:link style="text-align: center" target="./index.xhtml" value="Data set similarity"/>
                </p:layoutUnit>

                <p:layoutUnit position="west" size="200"  header="Menu" collapsible="true" resizable="true">
                     <ui:include src="./component/menuUser.xhtml"></ui:include>                   
                </p:layoutUnit>

                <p:layoutUnit position="center">

                    <h:form>  
                        
                   <p:contextMenu for="datasets">  
                        <p:menuitem value="View" update="display" icon="ui-icon-search" oncomplete="datasetDialog.show()"/>  
                        <p:menuitem value="Update" update="datasets" icon="ui-icon-search" ajax="false" action="#{mbdataset.update()}"/>  
                    </p:contextMenu> 
                        
                        <p:dataTable id="datasets" var="datasetdt" value="#{mbdataset.allDatasets}" 
                                     selectionMode="single" selection="#{mbdataset.selectedds}" rowKey="#{datasetdt.dataSetID}">  
                            <p:column headerText="Data set ID">
                                <h:outputText value="#{datasetdt.dataSetID}"/>  
                            </p:column>  

                            <p:column headerText="Title">  
                                <h:outputText value="#{datasetdt.title}" />  
                            </p:column>  

                            <p:column headerText="Description">  
                                <h:outputText value="#{datasetdt.dsDescription}" />  
                            </p:column>  
                        </p:dataTable>  
                        
                        
                        <p:dialog header="Dataset Detail" widgetVar="datasetDialog" resizable="false"  
                              width="500" showEffect="clip" hideEffect="fold" id="dialog">  

                        <h:panelGrid id="display" columns="2" cellpadding="6">  
                            <h:outputText value="DatasetID:" />  
                            <h:outputText value="#{mbdataset.selectedds.dataSetID}" style="font-weight:bold"/>  
                            <h:outputText value="Dataset title" />  
                            <h:outputText value="#{mbdataset.selectedds.title}" style="font-weight:bold"/>  
                            <h:outputText value="Description:" />  
                            <h:outputText value="#{mbdataset.selectedds.dsDescription}" style="font-weight:bold"/>  
                            <h:outputText value="Source creator:" />  
                            <h:outputText value="#{mbdataset.selectedds.source.creator}" style="font-weight:bold"/>  
                            <h:outputText value="Source donor" />  
                            <h:outputText value="#{mbdataset.selectedds.source.donor}" style="font-weight:bold"/>  
                            <h:outputText value="Source date:" />  
                            <h:outputText value="#{mbdataset.selectedds.source.sourceDate}" style="font-weight:bold"/>  
                        </h:panelGrid>  
                    </p:dialog>  

                        
                        
                    </h:form>  
                </p:layoutUnit>

            </p:layout>
    </h:body>
</html>
